package translated;

import java.util.List;
import edu.pku.sei.modeler.jet.model.*;
import edu.pku.sei.modeler.model.core.*;
import edu.pku.sei.modeler.jet.util.*;

public class SampleActionProviderGen
{
  protected static String nl;
  public static synchronized SampleActionProviderGen create(String lineSeparator)
  {
    nl = lineSeparator;
    SampleActionProviderGen result = new SampleActionProviderGen();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "/**" + NL + " * Copyright (c) Software Institute of PKU" + NL + " * All rights reserved. " + NL + " * This program and the accompanying materials" + NL + " * are made available under the terms of the Eclipse Public License v1.0" + NL + " * which accompanies this distribution, and is available at" + NL + " * http://www.eclipse.org/legal/epl-v10.html" + NL + " *" + NL + " */" + NL + "package ";
  protected final String TEXT_2 = ";" + NL + "" + NL + "import java.util.List;" + NL + "" + NL + "import org.eclipse.jface.action.Action;" + NL + "" + NL + "import edu.pku.sei.modeler.model.core.MetaPackage;" + NL + "import edu.pku.sei.modeler.model.structure.MetaDiagram;" + NL + "import edu.pku.sei.modeler.project.AbstractModelingProject;" + NL + "import edu.pku.sei.modeler.actions.OpenDiagramAction;" + NL + "import edu.pku.sei.modeler.actions.MetaTreeViewerActionGroup;" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " *" + NL + " */" + NL + "public class ";
  protected final String TEXT_3 = " implements ITreeActionProvider {" + NL + "\tpublic ";
  protected final String TEXT_4 = "( ){" + NL + "\t\t" + NL + "\t}" + NL + "" + NL + "\tpublic Action getDoubleClickAction(Object treeObj) {" + NL + "\t\tif(treeObj instanceof MetaDiagram) {" + NL + "\t\t\tOpenDiagramAction opa = new OpenDiagramAction();" + NL + "\t\t\topa.setTreeObj(treeObj);" + NL + "\t\t\treturn opa;" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\tpublic MetaTreeViewerActionGroup getTreeActionGroup(List treeList) {" + NL + "\t\tMetaTreeViewerActionGroup treeActionGroup = new MetaTreeViewerActionGroup();" + NL + "\t\tif(treeList.size()<1)return treeActionGroup;" + NL + "\t\tObject treeObj = treeList.get(0);" + NL + "\t\tif(treeObj instanceof AbstractModelingProject){" + NL + "\t\t\tSampleAction action = new SampleAction();" + NL + "\t\t\taction.setTreeObj(treeObj);" + NL + "\t\t\ttreeActionGroup.addAction(action);" + NL + "\t\t}" + NL + "\t\treturn treeActionGroup;" + NL + "\t}" + NL + "}";
  protected final String TEXT_5 = NL;

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    stringBuffer.append(TEXT_1);
    stringBuffer.append(ModelerConstants.pkgBase + "." + ModelerConstants.actionBase);
    stringBuffer.append(TEXT_2);
    stringBuffer.append(ModelerConstants.actionPrivider);
    stringBuffer.append(TEXT_3);
    stringBuffer.append(ModelerConstants.actionPrivider);
    stringBuffer.append(TEXT_4);
    stringBuffer.append(TEXT_5);
    return stringBuffer.toString();
  }
}
